<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ include file="../common.inc" %>    
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<link href="./css/style1.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="./js/form.js"></script>
<script type="text/javascript" language="javascript">
<!--
	function otherInfo(){
		window.location.href = "./dictionarySet.do?action=otherInfo";
		window.location.target = "main";
	}
	
	function linkmainInfo(){
		window.location.href = "./dictionarySet.do?action=linkmanInfo";
		window.location.target = "main";
	}
	
	function addRange(id,value){
		if(value == 'country'){
			window.location.href = "./recordRange.do?action=preAddCountry&sign=1&id="+id;
		}else if(value == 'province'){
			window.location.href = "./recordRange.do?action=preAddProvince&sign=1&id="+id;
		}else if(value == "city"){
			window.location.href = "./recordRange.do?action=preAddCity&sign=1&id="+id;
		}else if(value == "industryDetail"){
			window.location.href = "./recordRange.do?action=preAddIndustryDetail&id="+id;
		}else{
			window.location.href = "./recordRange.do?action=display&sign=1&id="+id;
		}
		window.location.target = "main";
	}
	
	function save(){
		document.customerDictionaryForm.action = "./dictionarySet.do?action=saveCustomerInfo";
		document.customerDictionaryForm.target = "main";
		document.customerDictionaryForm.submit();
	}
	
	function initPage(){
		if("<c:out value='${result}'/>" == 1){
			alert("<fmt:message key='common.message.addSuccess'/>");
		}
	}
-->
</script>
</head>
<body onload="initPage()">
<form name="customerDictionaryForm" action="" method="post">
	<table class="table_frame">
		<tr>
			<td>
				<table class="table_title1">
					<tr>
						<td class="title_lab" colspan="2">
							<fmt:message key='dic.title.customerInfo'/>
						</td>
					</tr>
					<tr>
						<td valign="bottom" class="a_tools" style="padding-left: 3px;">
							<a href="javascript:save();" title="<fmt:message key='common.button.save'/>" hidefocus="true"><fmt:message key='common.button.save'/></a>
							|
							<a class="viewlinkman" href="javascript:linkmainInfo();" title="<fmt:message key='common.button.linkman'/>" hidefocus="true"><fmt:message key='common.button.linkman'/></a>
							<a class="other" href="javascript:otherInfo();" title="<fmt:message key='common.button.other'/>" hidefocus="true"><fmt:message key='common.button.other'/></a>
						</td>
						<td></td>
					</tr>
					<tr><td height="2"></td></tr>
				</table>
			</td>
		</tr>
		<tr>
			<td valign="top">
				<table class="table_title2">
					<tr>
						<td class="title_lab">
							客户信息字典
						</td>
						<td align="left" width="85%"><fmt:message key='dic.lable.customerCodeMethod'/></td>
					</tr>
					<tr>
						<td colspan="2" valign="top">
							<div style="width:100%;height:420px;overflow-x: hidden;overflow-y: scroll;">
							<table class="table_style">
								<tr>
									<td class="title" width="8"></td>
									<td class="title" width="60"><fmt:message key='dic.lable.isDisplay'/></td>
									<td class="title" width="15%"><fmt:message key='dic.lable.currentRecord'/></td>
									<td class="title" width="16%"><fmt:message key='dic.lable.updated'/></td>
									<td class="title"><fmt:message key='dic.lable.recordDesc'/></td>
									<td class="title" width="15%"><fmt:message key='dic.lable.primitiveRecord'/></td>
									<td class="title" width="8%"><fmt:message key='common.lable.operate'/></td>
								</tr>
								<c:forEach var="customerInfo" items="${customerInfos}">
								<tr onmouseover="onmousemoveChange(this,'img${customerInfo.id}')" onmouseout="onmouseoutChange(this,'img${customerInfo.id}')">
									<td height="16" width="8" align="right"><img id="img${customerInfo.id}" src="./images/table_sign2.bmp"></td>
									<td>
										<input id="cid" name="cid" 
											type="checkbox" <c:if test='${customerInfo.status == 1 || customerInfo.status == 2}'>checked</c:if> <c:if test='${customerInfo.status == 2}'>disabled</c:if> 
											value="${customerInfo.id}"/>
										<input id="id" name="id" type="hidden" value="${customerInfo.id}"/>
									</td>
									<td>
										<c:choose>
											<c:when test="${language == 2}">${customerInfo.currentRecordEn}</c:when>
											<c:otherwise>${customerInfo.currentRecord}</c:otherwise>
										</c:choose>
									</td>
									<td><input id="currentRecord" name="currentRecord" class="input_percent" type="text"/></td>
									<td>
										<input id="recordDesc" name="recordDesc" class="input_percent" type="text" 
											value="<c:choose><c:when test='${language == 2}'>${customerInfo.recordDescEn}</c:when><c:otherwise>${customerInfo.recordDesc}</c:otherwise></c:choose>" />
									</td>
									<td><fmt:message key="${customerInfo.primitiveRecordKey}"/></td>
									<td>
										<c:if test="${customerInfo.isRange == '1'}">
											<c:choose>
												<c:when test="${customerInfo.recordCode == '124'}">
													<img class="btn_img" src="./images/a_addrange.gif" onclick="addRange(${customerInfo.id},'country')" title="<fmt:message key='dic.lable.addRange'/>">
												</c:when>
												<c:when test="${customerInfo.recordCode == '125'}">
													<img class="btn_img" src="./images/a_addrange.gif" onclick="addRange(${customerInfo.id},'province')" title="<fmt:message key='dic.lable.addRange'/>">
												</c:when>
												<c:when test="${customerInfo.recordCode == '126'}">
													<img class="btn_img" src="./images/a_addrange.gif" onclick="addRange(${customerInfo.id},'city')" title="<fmt:message key='dic.lable.addRange'/>">
												</c:when>
												<c:when test="${customerInfo.recordCode == '127'}">
													<img class="btn_img" src="./images/a_addrange.gif" onclick="addRange(${customerInfo.id},'industryDetail')" title="<fmt:message key='dic.lable.addRange'/>">
												</c:when>
												<c:otherwise>
													<img class="btn_img" src="./images/a_addrange.gif" onclick="addRange(${customerInfo.id},'')" title="<fmt:message key='dic.lable.addRange'/>">
												</c:otherwise>
											</c:choose>
										</c:if>
									</td>
								</tr>
								</c:forEach>
							</table>
							</div>
						</td>
					</tr>
				</table>
			</td>
		</tr>
	</table>
</form>
</body>
</html>